﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Media;

namespace PacMan
{
    class SoundManager
    {
        Queue<SoundPlayer> playlist = new Queue<SoundPlayer>();

        public void AddToPlaylist(string sound) 
        {
            playlist.Enqueue(new SoundPlayer(sound));
        }

        public void Play() 
        {
            if (playlist.Count != 0)
            {
                var sound = playlist.Dequeue();
                sound.Play();
            }
        }
    }
}
